<template>
    <div >
        <div class="top">
            <div class="left fl">
                    <p class="title">
                        {{list.yymc}}
                        <span>{{list.ksmc}}</span>
                    </p>
                    <p>就诊人：{{nameAndAge.xm}}</p>
                    <p>就诊日期：{{list.jzrq}}</p>
              </div>
        </div>
        <div class="bottom">
            <commonTable :listData="CISPrescription"></commonTable>
        </div>
        <!-- 数据仅供参考提示，hosName通过接口获得，在该组件赋值传给子组件，首页不需要传值，默认为空 -->
        <tips :hosName="hosName"></tips>
        <!-- 水印 -->
        <div class="watermark"></div>
    </div>
</template>

<script>
import tips from '@/components/tips.vue'
import commonTable from '@/components/table'
export default {
    name: 'mjzcf',
    data () {
        return {
            CISPrescription:{"yljgdm":"","jzlsh":"","name":"Mzxx"},//门诊用药信息的参数42502656400/15102400130024
            msg: 'Welcome to Your Vue.js App',
            hosName:JSON.parse(localStorage.getItem('mzjbxx')).yymc,//医院名称
            nameAndAge:JSON.parse(localStorage.getItem('jbxx')),
            list:JSON.parse(localStorage.getItem('mzjbxx')),
        }
    },
    components:{
        commonTable,tips
    },
    created() {
        this.CISPrescription.yljgdm = JSON.parse(localStorage.getItem('mzjbxx')).yljgdm;
        this.CISPrescription.jzlsh = JSON.parse(localStorage.getItem('mzjbxx')).jzlsh;
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.fl{
    float:left;
}
.fr{
    float:right;
}
.top{
    overflow: hidden;
    padding:1rem;
    background: #fff;
    font-size: 1rem;
    color:#969696;
    border-bottom:#DCDCDC solid 1px;
    .left{
        p{
            margin-bottom:0.2rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            span{
                margin-left:1rem;
            }
        }
        .title{
            font-size: 1.2rem;
            color: #333333;
            font-weight: bold;
        }
    }
    .item:last-child{
        margin-bottom:0;
    }
}
.bottom{
    padding:1rem;
    background: #fff;
}
</style>
